home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 8
/
The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO
/
prg_casm
/
snpd9611.zip
/
STRCHCAT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-11-24
|
1KB
|
46 lines
.I 0 2
/* +++Date last modified: 24-Nov-1996 */
.I 7 1
** Returns: Pointer to modified string, or NULL if insufficient space
.D 8 1
.I 12 10
** The user is granted a free limited license to use this source file
** to create royalty-free programs, subject to the terms of the
** license restrictions specified in the LICENSE.MFL file.
**
** NOTE: The name of this funtion violates ANSI/ISO 9899:1990 sec. 7.1.3,
** but this violation seems preferable to either violating sec. 7.13.8
** or coming up with some hideous mixed-case or underscore infested
** naming. Also, many SNIPPETS str---() functions duplicate existing
** functions which are supported by various vendors, so the naming
** violation may be required for portability.
.D 13 1
.I 19 5
#if defined(__cplusplus) && __cplusplus
extern "C" {
#endif
char *strchcat(char *string, int ch, size_t buflen)
.D 20 1
.I 31 4
#if defined(__cplusplus) && __cplusplus
}
#endif
.I 37 6
char buf1[80] = "This buffer's big enough",
buf2[] = "This one's not";
char *ptr;
printf("strchcat(\"%s\", '!') ", buf1);
ptr = strchcat(buf1, '!', sizeof(buf1));
.D 38 5
.I 47 2
printf("strchcat(\"%s\", '!') ", buf2);
ptr = strchcat(buf2, '!', sizeof(buf2));
.D 48 2
.I 56 1
#endif /* TEST */
.D 57 1